// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.modules.dao.impl;

import com.liuxinlong.modules.dao.PatentRiskProcessDao;
import com.liuxinlong.modules.entity.PatentRiskProcess;
import com.liuxinlong.modules.mapper.PatentRiskProcessMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 类描述
 * <p>
 * 此类关联设计的功能
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2024年5月20日
 */
@Service
public class PatentRiskProcessDaoImpl extends ServiceImpl<PatentRiskProcessMapper, PatentRiskProcess>
        implements PatentRiskProcessDao {

    @Override
    public List<PatentRiskProcess> pagePatentRiskProcessList(Map<String, Object> queryParam) {
        return baseMapper.pagePatentRiskProcessList(queryParam);
    }

    @Override
    public int getPatentRiskProcessCount(Map<String, Object> queryParam) {
        return baseMapper.getPatentRiskProcessCount(queryParam);
    }

    @Override
    public List<PatentRiskProcess> getPatentRiskProcessList() {
        return baseMapper.getPatentRiskProcessList();
    }

    @Override
    public Map<String, Map<String, String>> getPatentRiskProcessMap() {
        return baseMapper.getPatentRiskProcessMap();
    }

    @Override
    public Map<String, PatentRiskProcess> getProjectPatentRiskProcessMap(String projectId) {
        Map<String,Object> queryParam = new HashMap<>();
        queryParam.put("projectId",projectId);
        queryParam.put("startNum",0);
        queryParam.put("pageSize",10000);
        List<PatentRiskProcess> riskList = baseMapper.pagePatentRiskProcessList(queryParam);
        Map<String, PatentRiskProcess> riskMap = new HashMap<>();
        for (PatentRiskProcess risk : riskList) {
            riskMap.put(risk.getId(),risk);
        }
        return riskMap;
    }

    @Override
    public PatentRiskProcess getCurrentSort(String projectId) {
        return baseMapper.getCurrentSort(projectId);
    }
}
